#include "img_struct.h"

#undef USE_IRC680_AEB_PARAM

statistics_config_t mt9p006_tile_config = {
	1,
	1,

	24,
	16,
	128,
	48,
	160,
	250,
	160,
	250,
	0,
	16383,

	12,
	8,
	0,
	8,
	340,
	512,

	8,
	5,
	256,
	10,
	448,
	816,
	448,
	816,

	0,
	16383,
};
 line_t mt9p006_50hz_lines[] = {
		{
		{{SHUTTER_1BY8000, ISO_100, 0}}, {{SHUTTER_1BY100, ISO_100,0}}
		},

		{
		{{SHUTTER_1BY100, ISO_100, 0}}, {{SHUTTER_1BY100, ISO_300, 0}}
		},

		{
		{{SHUTTER_1BY50, ISO_100, 0}}, {{SHUTTER_1BY50, ISO_800,0}}
		},

		{
		{{SHUTTER_1BY30, ISO_100, 0}}, {{SHUTTER_1BY30, ISO_6400,0}}
		}
};

 line_t mt9p006_60hz_lines[] = {
		{
		{{SHUTTER_1BY8000, ISO_100, 0}}, {{SHUTTER_1BY120, ISO_100,0}}
		},

		{
		{{SHUTTER_1BY120, ISO_100, 0}}, {{SHUTTER_1BY120, ISO_300, 0}}
		},

		{
		{{SHUTTER_1BY60, ISO_100, 0}}, {{SHUTTER_1BY60, ISO_800,0}}
		},

		{
		{{SHUTTER_1BY30, ISO_100, 0}}, {{SHUTTER_1BY30, ISO_6400,0}}
		}
};

#ifdef USE_IRC680_AEB_PARAM
// use IRC680 aeb params.
img_awb_param_t mt9p006_awb_param = {
	{
		{1050, 1024, 1650},	//AUTOMATIC
		{ 775, 1024, 2400},	//INCANDESCENT
		{875, 1024, 2175},		//D4000
		{1050, 1024, 1650},	//D5000
		{1250, 1024, 1500},	//SUNNY
		{1300, 1024, 1400},	//CLOUDY
		{1250, 1024, 2300},	//FLASH
		{1583, 1024, 1606},	//FLUORESCENT
		{2144, 1024, 1127},	//FLUORESCENT_H
		{2144, 1024, 1127},	//UNDER WATER
		{2144, 1024, 1127},	//CUSTOM
		{1050, 1024, 1650},	//AUTOMATIC OUTDOOR
	},
	{
		12,
		{{550, 1200, 2000, 2800,  -2500, 3500,  -1900, 4550, 1000, 1200,  1000, 2150,  1},// 0, INCANDESCENT
		{600, 1450, 1600, 2550,  -2000, 3150,  -1900, 4550, 800, 1000,  1000, 1500,  2 }, // 1, D4000
		{750,  1500, 1300, 2100,  -2000,  3150,  -1900,  4500,  1000, 350,  1000, 950,  4}, // 2, D5000 
		{900, 1600, 1200, 1800,  -2000,  3150,   -1900, 4500,  500, 700,  550, 1100,  8}, // 3, SUNNY
		{1050, 1600, 1100, 1700,  -1000, 2200,   -750, 2700,  500, 400,  550, 950,  4}, // 4, CLOUDY
		{	 0,    0,	 0,    0,	  0,	0,	   0,	 0,   0,   0,	 0,    0, 0 }, // 5, PROJECTOR 
		{1100, 1450, 1650, 2900, -3000, 5100, -2800, 6600, 1000, 350, 3500, -2100, -1},	// 6	GREEN REGION
		{	 0,    0,	 0,    0,	  0,	0,	   0,	 0,   0,   0,	 0,    0, 0 },	// 7	FLASH
		{1100,1400,2050,2550,-2500,4900,-1900,5000,1000,700,1000,1400,1},	// 8	FLUORESCENT		
		{	 0,    0,	 0,    0,	  0,	0,	   0,	 0,   0,   0,	 0,    0, 0 },	// 9	FLUORESCENT_2
		{	 0,    0,	 0,    0,	  0,	0,	   0,	 0,   0,   0,	 0,    0, 0 },	// 10	FLUORESCENT_3
		{	 0,    0,	 0,    0,	  0,	0,	   0,	 0,   0,   0,	 0,    0, 0 }}, // 11	FLUORESCENT_4,
	},
	{	{ 0 ,6},	//LUT num. AUTOMATIC  INDOOR
		{ 0, 1},	//LUT num. INCANDESCENT
		{ 1, 1},	//LUT num. D4000
		{ 2, 1},	//LUT num. D5000
		{ 2, 5},	//LUT num. SUNNY
		{ 4, 3},	//LUT num. CLOUDY
		{ 7, 1},	//LUT num. FLASH
		{ 8, 1},	//LUT num. FLUORESCENT
		{ 9, 1},	//LUT num. FLUORESCENT_H
		{11, 1},	//LUT num. UNDER WATER
		{11, 1},	//LUT num. CUSTOM
		{ 0, 7},	//LUT num. AUTOMATIC  OUTDOOR
	 }
};
#else
// use IRC650 aeb params.
img_awb_param_t mt9p006_awb_param = {
	{
		{1475, 1024, 1450},	//AUTOMATIC
		{980, 1024, 2450},	//INCANDESCENT
		{1100, 1024, 2125},		//D4000
		{1350, 1024, 1650},	//D5000
		{1475, 1024, 1450},	//SUNNY
		{1575, 1024, 1400},	//CLOUDY
		{1250, 1024, 2300},	//FLASH
		{1583, 1024, 1606},	//FLUORESCENT
		{2144, 1024, 1127},	//FLUORESCENT_H
		{2144, 1024, 1127},	//UNDER WATER
		{2144, 1024, 1127},	//CUSTOM
		{1050, 1024, 1650},	//AUTOMATIC OUTDOOR
	},
	{
		12,
		{{700, 1350, 2000, 2800,  -2000, 3650,  -1900, 4800, 1000, 1300,  1000, 2000,  1},// 0, INCANDESCENT
		{750, 1500, 1600, 2600,  -2000, 3650,  -1900, 5200, 800, 1000,  1000, 1350,  2 }, // 1, D4000
		{900,  1700, 1300, 2100,  -2000,  3650,  -1900,  4800,  800, 400,  800, 1050,  4}, // 2, D5000 
		{1000, 1800, 1200, 1800,  -2000,  3650,   -1900, 4800,  500, 600,  550, 830,  8}, // 3, SUNNY
		{1100, 1850, 1100, 1700,  -2000, 3650,   -1900, 4800,  500, 300,  550, 620,  4}, // 4, CLOUDY
		{	 0,    0,	 0,    0,	  0,	0,	   0,	 0,   0,   0,	 0,    0, 0 }, // 5, PROJECTOR 
		{1200, 1700, 1600, 2900, -2000, 4500, -2800, 6600, 1000, 0, 3500, -2700, -1},	// 6	GREEN REGION
		{	 0,    0,	 0,    0,	  0,	0,	   0,	 0,   0,   0,	 0,    0, 0 },	// 7	FLASH
		{1200,1500,2200,2600,-1900,4600,-1900,5200,1000,800,1000,1400,1},	// 8	FLUORESCENT		
		{	 0,    0,	 0,    0,	  0,	0,	   0,	 0,   0,   0,	 0,    0, 0 },	// 9	FLUORESCENT_2
		{	 0,    0,	 0,    0,	  0,	0,	   0,	 0,   0,   0,	 0,    0, 0 },	// 10	FLUORESCENT_3
		{	 0,    0,	 0,    0,	  0,	0,	   0,	 0,   0,   0,	 0,    0, 0 }}, // 11	FLUORESCENT_4,
	},
	{	{ 0 ,6},	//LUT num. AUTOMATIC  INDOOR
		{ 0, 1},	//LUT num. INCANDESCENT
		{ 1, 1},	//LUT num. D4000
		{ 2, 1},	//LUT num. D5000
		{ 2, 5},	//LUT num. SUNNY
		{ 4, 3},	//LUT num. CLOUDY
		{ 7, 1},	//LUT num. FLASH
		{ 8, 1},	//LUT num. FLUORESCENT
		{ 9, 1},	//LUT num. FLUORESCENT_H
		{11, 1},	//LUT num. UNDER WATER
		{11, 1},	//LUT num. CUSTOM
		{ 0, 7},	//LUT num. AUTOMATIC  OUTDOOR
	 }
};
#endif

u32 mt9p006_ae_agc_dgain[AGC_DGAIN_TABLE_LENGTH]={
	989,
	995,1000,1006,889,894,899,904,909,914,918,924,929,933,939,943,949,
	954,959,964,969,974,979,984,895,900,905,909,914,919,923,928,933,
	938,943,949,954,959,965,970,974,980,985,990,898,902,907,912,917,
	922,927,932,937,942,948,953,958,963,968,974,901,906,911,915,921,
	926,931,936,941,946,951,957,962,967,972,977,902,907,913,918,923,
	928,934,938,944,949,954,959,964,970,975,980,919,925,929,934,938,
	943,949,954,959,964,969,974,909,914,919,924,929,934,939,944,948,
	954,959,964,919,924,929,935,940,945,950,955,986,992,997,1003,946,
	951,956,961,966,972,977,983,988,993,999,1004,957,962,968,972,978,
	983,989,995,944,949,955,960,965,970,976,981,986,991,996,1002,1007,
	961,967,972,978,983,989,995,1000,956,961,966,971,977,982,987,993,
	956,961,966,971,976,982,987,993,953,958,963,969,974,979,984,989,
	954,959,964,970,975,980,985,991,954,960,965,971,976,981,986,992,
	962,968,973,978,984,989,995,1001,967,973,978,983,953,958,963,969,
	975,979,985,990,960,965,970,976,981,986,992,997,973,978,983,989,
	961,966,972,977,982,987,993,998,984,990,995,1000,975,981,986,992,
	998,1003,1008,1014,993,999,1004,1009,985,991,996,1001,978,984,989,994,
	1000,1005,1010,1016,993,998,1004,1009,991,996,1002,1007,986,992,997,1002,
	984,989,994,1000,981,985,992,997,982,987,992,998,1003,1008,1014,1020,
	1001,1007,1012,1018,1000,1006,1011,1017,1000,1005,1010,1016,1002,1008,1014,1019,
	1003,1009,1014,1020,1008,1013,1019,1024,1010,1015,1021,1026,1014,1019,1025,1031,
	997,1002,1008,1014,1002,1007,1013,1018,1024,1013,1019,1024,1030,1017,1024,1029,
	1034,1021,1026,1032,1037,1026,1031,1037,1042,1017,1022,1027,1033,1021,1027,1032,
	1038,1027,1032,1038,1043,1021,1026,1031,1037,1012,1017,1023,1028,1019,1025,1031,
	1036,1025,1031,1037,1042,1014,1019,1025,1031,1023,1029,1034,1040,1030,1035,1041,
	1047,1022,1027,1033,1039,1010,1015,1021,1026,1016,1021,1027,1033,1025,1030,1036,
	1042,1032,1038,1044,1049,1012,1018,1023,1029,1017,1022,1028,1033,1003,1009,1014,
	1020,1011,1017,1023,1029,1018,1024,1029,1035,1023,1028,1034,1040,1016,1022,1028,
	1033,1023,1029,1034,1040,1015,1020,1026,1031,1017,1023,1028,1033,1008,1013,1018,
	1023,1013,1018,1024,1030,1017,1022,1028,1033,1010,1016,1021,1027,1017,1023,1028,
	1034,1011,1017,1022,1028,1017,1022,1028,1033,1008,1013,1019,1025,1012,1017,1023,
	1029,1019,1025,1030,1036,1013,1018,1024,1030,1006,1012,1017,1023,1014,1020,1025,
	1031,1020,1025,1031,1036,1009,1015,1020,1026,1018,1024,1029,1035,1025,1031,1037,
	1042,1035,1003,1009,1014,1020,1009,1014,1020,1025,1016,1022,1028,1034,1024,1029,
	1035,1040,1013,1018,1022,1030,1022,1027,1033,1038,1029,1034,1040,1046,1005,1011,
	1017,1022,1013,1019,1024,1029,1019,1024,1029,1035,1023,1028,1034,1039,1016,1022,
	1027,1032,1023,1028,1034,1040,1016,1022,1028,1034,1025,1030,1036,1042,1013,1019,
	1025,1030,1020,1026,1031,1037,1029,1034,1040,1046,1036,1042,1047,1053,1012,1018,
	1024,1029,1016,1021,1027,1032,1021,1026,1032,1038,1013,1019,1024,1030,1018,1024,
	1030,1035,1025,1031,1037,1042,1022,1027,1033,1038,1025,1031,1036,1042,1018,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,

	};
u32 mt9p006_ae_sht_dgain_3m15[SHUTTER_DGAIN_TABLE_LENGTH]=
{
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,

	1024,1018,1035,1028,1025,1020,1014,1009,1024,1018,1012,1007,1001,1017,1013,1006,1000,996,
	991,986,1004,994,990,984,979,973,992,988,983,974,971,961,962,981,978,972,968,962,957,980,
	974,969,963,958,953,948,942,965,960,954,948,942,937,932,958,952,946,941,936,933,928,922,
	949,945,940,935,930,925,921,915,945,940,935,930,925,919,913,909,942,937,932,927,921,916,
	911,906,901,937,932,927,922,918,913,909,904,898,935,931,926,922,918,915,909,906,901,896,
	938,933,928,923,918,912,905,898,894,886,930,925,918,913,907,902,897,893,887,883,878,918,
	922,918,914,910,908,904,898,895,892,886,940,936,931,925,917,911,905,899,892,887,881,874,
	869,923,919,914,910,906,902,898,894,891,888,883,879,874,934,929,924,918,912,907,902,895,
	889,884,877,872,867,862,926,922,918,914,911,907,902,899,894,890,888,884,880,875,873,867,
	937,931,925,918,912,906,901,894,888,883,878,874,870,867,864,861,940,935,931,926,920,916,
	909,903,896,889,884,877,873,868,862,857,854,849,847,933,930,926,922,917,914,909,904,898,
	893,887,882,876,870,863,859,854,849,844,840,935,930,928,924,918,915,912,909,904,898,892,
	887,884,878,874,868,865,859,855,850,845,841,835,834,901,894,888,882,879,873,870,865,858,
	856,850,847,841,836,832,828,824,818,814,810,806,800,796,792,787,786,870,862,857,850,848,
	843,840,832,827,824,818,814,809,806,798,796,792,788,785,780,774,770,765,763,761,755,750,
	745,743,737,734,840,835,830,825,819,814,810,805,800,796,792,787,783,779,775,772,767,764,
	761,756,755,750,746,742,738,733,731,727,724,719,715,711,707,702,698,693,690,837,831,826,
	823,818,812,808,803,799,795,791,787,783,779,775,771,767,764,761,756,754,749,746,742,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,
	738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,


};

u32 mt9p006_ae_sht_dgain_5m12[SHUTTER_DGAIN_TABLE_LENGTH]=
{
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,
	1024,1018,1012,1027,1023,1017,1011,1005,1000,993,1011,1005,999,995,988,983,978,994,
	989,984,977,971,966,962,956,973,968,961,955,950,945,940,960,955,950,944,939,935,929,
	925,947,942,938,933,927,922,917,912,908,932,927,923,918,914,910,904,899,894,920,916,
	909,904,900,895,889,884,880,905,900,895,890,885,881,876,871,866,860,888,883,879,873,
	869,865,860,855,850,845,875,872,867,862,858,854,849,844,839,834,830,862,858,853,849,
	843,838,833,829,824,819,814,850,846,841,837,832,827,822,818,813,810,806,801,796,838,
	833,828,824,820,817,811,806,802,798,793,789,785,832,827,822,818,814,808,804,799,794,
	790,785,781,776,773,823,819,814,810,807,803,798,793,789,785,781,777,772,768,764,821,
	817,813,809,804,801,797,793,788,785,780,775,771,768,764,761,757,822,818,814,808,804,
	800,796,792,788,784,779,776,772,768,763,759,755,751,748,824,818,813,809,806,801,797,
	792,787,783,780,775,771,766,761,758,752,748,744,740,823,818,814,809,805,801,798,792,
	788,783,779,775,771,765,761,757,752,748,745,742,738,735,731,827,822,817,814,809,805,
	801,798,794,791,786,782,777,772,768,764,758,755,751,746,743,739,734,731,726,720,714,
	788,786,780,777,772,768,764,758,755,752,747,743,739,736,732,729,726,721,718,713,710,
	706,701,697,694,690,686,682,679,675,672,768,758,755,749,746,743,739,734,730,726,722,
	718,714,709,706,702,699,694,691,687,683,679,676,672,669,665,662,659,655,651,649,645,
	642,638,634,632,627,755,750,745,740,737,733,728,724,720,715,712,709,706,702,700,695,
	692,688,685,682,679,676,672,669,664,661,657,653,649,645,641,638,634,631,627,623,620,
	617,613,609,607,603,600,597,593,590,773,767,764,760,756,753,748,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
	744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,
};

u32 mt9p006_ae_sht_dgain_1080p[SHUTTER_DGAIN_TABLE_LENGTH] =
{
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,	
	1024,1045,1036,1025,1014,1004,1024,1019,1014,1010,1005,998,1024,1019,1014,1009,
	1004,998,1024,1018,1013,1008,1002,996,1024,1018,1011,1007,1001,995,1024,1018,
	1011,1005,1001,995,1024,1020,1015,1009,1003,999,993,1024,1019,1013,1008,1004,
	998,993,1024,1020,1012,1007,1001,996,990,1024,1018,1012,1007,1001,994,989,
	1024,1017,1013,1007,1004,1000,993,987,1024,1018,1011,1005,1000,995,987,982,
	1024,1017,1011,1007,1000,994,988,984,1024,1019,1014,1009,1004,998,993,987,
	980,1024,1018,1012,1006,1000,994,989,982,977,1024,1017,1011,1006,1001,995,
	989,984,980,975,1024,1020,1012,1007,1002,996,990,985,979,972,1024,1019,
	1012,1007,1002,997,992,986,980,976,969,1024,1020,1015,1011,1006,1001,996,
	992,985,981,973,968,1024,1018,1011,1004,998,992,985,979,974,969,963,
	959,1024,1019,1014,1010,1005,1000,994,989,983,978,972,964,958,1024,1017,
	1009,1002,996,989,982,976,972,966,961,957,954,949,1024,1021,1018,1014,
	1009,1004,999,993,988,981,974,967,961,955,948,942,1024,1017,1011,1007,
	1001,997,992,988,983,978,973,967,962,960,953,944,938,1024,1018,1011,
	1002,996,990,983,977,970,964,959,953,953,943,938,933,928,923,1024,
	1018,1014,1009,1004,998,993,989,984,978,972,966,961,956,950,944,939,
	933,927,921,913,1024,1017,1011,1006,994,987,981,975,973,966,955,950,
	944,939,934,929,924,920,915,910,905,901,897,1024,1019,1014,1009,1004,
	1000,995,988,987,977,971,965,960,953,947,940,934,929,923,917,910,
	904,897,891,885,880,1024,1016,1009,1002,998,993,988,981,976,968,960,
	955,950,944,938,932,927,921,917,912,907,902,897,890,886,881,875,
	871,865,860,854,1024,1021,1017,1010,1005,998,992,987,982,977,971,965,
	960,953,946,942,935,928,922,916,910,904,898,894,887,882,876,870,
	864,857,851,845,840,834,828,822,816,1024,1022,1021,1021,1020,1020,1020,
	1016,1016,1016,1014,1015,1013,1014,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
	1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,
};
u32 mt9p006_ae_sht_dgain[SHUTTER_DGAIN_TABLE_LENGTH]={

	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
	1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,
};
u8 mt9p006_dlight[2] = {128,4};
